package com.bailun91.auth.jwt;

import com.bailun91.auth.util.Constants;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.CredentialsMatcher;

import javax.xml.transform.Source;
import java.io.UnsupportedEncodingException;

public class JwtCredentialsMatcher implements CredentialsMatcher {

    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
        return JwtUtil.isTokenActive(token.getCredentials().toString());
    }
}
